#include<iostream>
#include<queue>
using namespace std;
struct node{
    int bh;
    int zt;
};
int a[300000];
int f1[300000];
int q[300000];
int main(){
    int n,l,r;
    cin>>n>>l>>r;
    for(int i=0;i<=n;i++){
        cin>>a[i];
    }
    for(int i=1;i<=n;i++)f1[i]=-0x3f3f3f3f;
    int ans=-0x3f3f3f3f;
    int head=0;
    int tail=0;
    for(int i=l;i<=n;i++){
        while(head<tail&&f1[q[tail]]<=f1[i-l])tail--;
        q[++tail]=i-l;
        while(head<tail&&q[head+1]<i-r)head++;
        f1[i]=f1[q[head+1]]+a[i];
        if(i+r>n)ans=max(ans,f1[i]);
    }
    cout<<ans;
    return 0;
}